package com.java0107;

import java.util.ArrayList;
import java.util.List;

public class ArrayList02 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();

        list.add("张三");
        list.add("李四");
        list.add("王五");

        for(String name:list){
            System.out.println(name);
        }
        list.forEach((n)->{
            System.out.println(n);
        });
    }
}
